package com.ycshihuo.shihuo.core.exception;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by guoxingye on 2016/10/11.
 */
@Controller
public class ExceptionController {

    @RequestMapping("/404")
    @ResponseBody
    public JSONObject error404() {
        return JSONObject.parseObject("{\"error\":\"404\", \"msg\":\"resource not found\"}");
    }

    @RequestMapping("/500")
    @ResponseBody
    public JSONObject error500() {
        return JSONObject.parseObject("{\"error\":\"500\", \"msg\":\"server error\"}");
    }


}

